/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import entity.Ordersipod;
import org.hibernate.Session;
import util.AppHibernateUtil;

/**
 *
 * @author Turtle
 */
public class OrdersIpodDAO {
    public static boolean insertOrder(Ordersipod order) {
        boolean success = false;
        Session session = AppHibernateUtil.getSessionFactory().openSession();
        
        try {
            session.beginTransaction();
            session.save(order);
            session.getTransaction().commit();
            success = true;
        } catch (Exception e) {
            System.out.println(e.getMessage());
            return success;
        } finally {
            session.close();
        }
        
        return success;
    }
}
